#ifndef _SYSTEMCLASS_H_
#define _SYSTEMCLASS_H_

#define WIN32_LEAN_AND_MEAN

#include <windows.h>

#include "inputclass.h"
#include "graphicsclass.h"
#include "Level2.h"
#include "MenuClass.h"
#include "fpsclass.h"
#include "HighScoreList.h"
#include "EllapsedTimer.h"
#include "resource.h"

using namespace frost;
using namespace menu;
using namespace text;

enum class GAMESTAT {MENU, LEVEL1, LEVEL2};

struct MyMouse 
{
	bool LeftButtonPressed;
	bool RightButtonPressed;
	int Xpos;
	int Ypos;
};

/** \brief Class for handling Windows messages
*
*/
class SystemClass
{
public:
	SystemClass();
	SystemClass(const SystemClass&);
	~SystemClass();

	bool Initialize();
	void Shutdown();
	void Run();

	LRESULT CALLBACK MessageHandler(HWND, UINT, WPARAM, LPARAM);
	LRESULT CALLBACK DialogMessageHandler(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam);
	

private:
	bool Frame();
	void InitializeWindows(int&, int&);
	void ShutdownWindows();
	bool StartLevel1(int, int, HWND);
	bool StartLevel2(int, int, HWND);

private:
	LPCWSTR m_applicationName;
	HINSTANCE m_hinstance;
	HWND m_hwnd;
	GAMESTAT gamestat;
	wchar_t m_Name[50];
	InputClass* m_Input;
	GraphicsClass* m_Graphics;
	MenuClass *m_Menu;
	FpsClass* m_Fps;
	HighScoreList *m_HighScoreList;
	EllapsedTimer *m_TimeCountDown;
	Level2 *m_Level2;

	int screenWidth;
	int screenHeight;
	bool done;
	int points;
	
	struct MyMouse *m_MyMouse;

	bool Level1IsStarted, Level2IsStarted, MenuIsStarted, EscapeIsPressed;;
};


static LRESULT CALLBACK WndProc(HWND, UINT, WPARAM, LPARAM);
static LRESULT CALLBACK DlgProc(HWND hWndDlg, UINT Msg, WPARAM wParam, LPARAM lParam);

static SystemClass* ApplicationHandle = 0;


#endif